If the child process ends before the parent process, the parent process calls the wait () function and does not call the wait () function to produce two different results: -- if the parent process does not call wait () and waitpid () function, the
From: http://hi.baidu.com/wlzqi/blog/item/208cebc4b1c02dab8326ac79.html
The wait function is prototype: # Include/* define the pid_t type */# IncludePid_t wait (int * Status) Once a process calls wait, it immediately blocks itself. Wait
If a child process is preceded by a parent process, the wait () function is invoked by the parent process and the wait () function is not invoked to produce two different results:--> If the parent process does not invoke the wait () and the Waitpid (
Man Wait:
NameWait, waitpid, waitid-wait for process to change state
Synopsis# Include # Include
Pid_t wait (int * status );
Pid_t waitpid (pid_t PID, int * status, int options );
Int waitid (idtype_t idtype, id_t ID, siginfo_t * INFOP, int options
1.8 wait
1.8.1 Overview
The wait function is prototype:
# Include /* define the pid_t type */# Include Pid_t wait (int * Status)
Once a process calls wait, it immediately blocks itself. Wait automatically analyzes
Author: LxmuyuLinks: Wait, waitpidWait1.1 IntroductionThe wait function requires a header file:#include #include Wait function prototype:pid_t Wait (int *status);Once the process has called wait, it immediately blocks itself, and the wait
#include /*provides a definition of type pid_t*/#includepid_t Wait (int*status) Once the process has called wait, it blocks itself immediately, and the wait automatically parses if a child process of the current process has exited, and if it finds
After creating the process, in order to avoid the zombie process, the waste of resources and the number of processes idle Occupy, you need to recycle the process resources, here the main look at wait and waitpid two processes function and difference!
1 wait
1.1 Introduction
The wait function is prototype:
# Include /* provides the pid_t type definition */# include pid_t wait (int * Status)
Once a process calls wait, it immediately blocks itself. Wait automatically analyzes whether a
I. botnets
When a child process exits, the kernel sends a sigchld signal to the parent process. The exit of the child process is an asynchronous event (the child process can be terminated at any time when the parent process is running)When a child
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.